home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / menus / mxmnu241.zip / INST.MNU < prev    next >
Text File  |  1992-08-25  |  13KB  |  443 lines

  1. Comment
  2. =========================================================
  3.  
  4. MarxMenu installation Menu:
  5.  
  6. Copyright 1989-1992 by Marc Perkel * All rights reserved.
  7.  
  8. This is an example of how MarxMenu can be used as a job control
  9. language. There is quite an education in MarxMenu tricks here. If
  10. you want to write a similar program, this menu is worth studying.
  11.  
  12. =========================================================
  13. EndComment
  14.  
  15. Var
  16.   EchoSt
  17.   FileLine
  18.   FileLinePtr
  19.   ProgName
  20.   BatExit
  21.   EchoTail
  22.   ConfigSysPath
  23.   ConfigSysLines
  24.   WorkStr
  25.   DosVerNumber
  26.  
  27. Const
  28.   PauseTime = 100
  29.  
  30. DelFile 'MENUS.EXE'
  31.  
  32. InitialDisplay
  33.  
  34. Shadow Off
  35. DrawBox 25 11 31 7
  36.  
  37. DosVerNumber = DosVersion * 100 + MinorDosVersion
  38.  
  39. ;MXECHO is a debugging environment variable. Use SET MXMENU=OFF for
  40. ;normal use. SET MXECHO=ON to watch the MARX.BAT run.
  41.  
  42. If ReadEnv('MXECHO') > ''
  43.    EchoTail = '%MXECHO%'
  44. Else
  45.    EchoTail = 'ON'
  46. EndIf
  47.  
  48. if DosVerNumber >= 330
  49.    EchoSt = '@ECHO ' + EchoTail
  50. else
  51.    EchoSt = 'ECHO ' + EchoTail
  52. endif
  53.  
  54.  
  55. ProgName = CleanFileName(Path + '\MARXMENU.EXE')
  56.  
  57. Write ' Creating MARX.BAT ... '
  58.  
  59. ;----- BatExit is a 0k bat file used to exit batch files
  60.  
  61. FileAssign (BatExit,'BATEXIT.BAT')
  62. FileCreate BatExit
  63. FileClose  BatExit
  64.  
  65. ;----- Here we create the MARX.BAT file.
  66.  
  67. ClearLineBuffer
  68.  
  69. AddLine (EchoSt)
  70. AddLine (ProgName + ' %1 ')
  71. AddLine ('%MXCMD%')
  72. AddLine (CleanFileName(Path + '\MARX.BAT') + ' %1')
  73. AddLine ('')
  74. AddLine ('Goto ERROR1')
  75. AddLine ('')
  76. AddLine ('*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*')
  77. AddLine ('')
  78. AddLine ('MarxMenu * CopyRight 1989-92 by Marc Perkel')
  79. AddLine ('')
  80. AddLine ('Once you are confident that MarxMenu is working correctly')
  81. AddLine ('the first line of this file can be changed to ECHO OFF.')
  82. AddLine ('')
  83. AddLine ('MarxMenu controls this batch file by writing to the environment')
  84. AddLine ('variable MXCMD.')
  85. AddLine ('')
  86. AddLine ('MXSTOP.BAT is executed to exit this batch file.')
  87. AddLine ('')
  88. AddLine ('*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*')
  89. AddLine ('')
  90. AddLine ('         MARX.BAT')
  91. AddLine ('         --------   +--MarxMenu Creates--+')
  92. AddLine ('  +----> @ECHO OFF  |                    |')
  93. AddLine ('  |      MARXMENU.EXE %1                 |')
  94. AddLine ('  |      %MXCMD% >--+                    +-> $MX00000.BAT')
  95. AddLine ('  | +--> MARX %1 +  |                        ------------')
  96. AddLine ('  | |            |  +----------------------> CD\WORDSTAR')
  97. AddLine ('  +-|------<-----+                           WS --+')
  98. AddLine ('    |                                             |')
  99. AddLine ('    +-------------------------------------------<-+')
  100. AddLine ('')
  101. AddLine ('Note: MarxMenu sets MXCMD = CALL $MX00000.BAT')
  102. AddLine ('')
  103. AddLine ('By Default, MarxMenu creates the temporary batch file in the same')
  104. AddLine ('directory as MARXMENU.EXE. If a second parameter is specified, and')
  105. AddLine ('the second parameter is a directory, then MarxMenu will create the')
  106. AddLine ('batch file there. If the second paramerer is a file name, then MarxMenu')
  107. AddLine ('will use it for the temporary file.')
  108. AddLine ('')
  109. AddLine ('If you set and environment variable TEMP to the name of a directory,')
  110. AddLine ("MarxMenu will use this directory for it's temporary batch files.")
  111. AddLine ('')
  112. AddLine ('Example SET TEMP=C:\TEMPFILE')
  113. AddLine ('')
  114. AddLine ('The MARX.BAT file must be path accessable or you will get a')
  115. AddLine ('"Bad Command or FileName" error. MARXMENU.EXE must also be path')
  116. AddLine ('accessable. The directory where MarxMenu creates temporary batch')
  117. AddLine ('files does not need to be path accessable.')
  118. AddLine ('')
  119. AddLine ('*-=-=-=-=-=-=-=-=-=-=[ Error Trapping Section ]-=-=-=-=-=-=-=-=-*')
  120. AddLine ('')
  121. AddLine ('If you get here it is probably because you moved the MARX.BAT file')
  122. AddLine ("from the directory you installed it to a new directory and didn't")
  123. AddLine ('change the path to MARXMENU.EXE and MARX.BAT in lines 2 and 4 of')
  124. AddLine ('this batch file.')
  125. AddLine ('')
  126. AddLine (':ERROR1')
  127. AddLine ('CLS')
  128. AddLine ('Echo  * * * * * * Warning * * * * * * *')
  129. AddLine ('Echo.')
  130. AddLine ('Echo  Line 4 of this batch file does not point to the directory')
  131. AddLine ('Echo  where MARX.BAT is located. Change to the directory where')
  132. AddLine ('Echo  the MARXMENU files are located and type MARXMENU INST to')
  133. AddLine ('Echo  re-create the MARX.BAT file for that directory.')
  134. AddLine ('')
  135. AddLine ('Goto ENDBAT')
  136. AddLine ('')
  137. AddLine ('*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*')
  138. AddLine ('')
  139. AddLine ('This exit point is used if MXSTOP.BAT can not be found. It is')
  140. AddLine ('usually caused by moving the MarxMenu files from one directory')
  141. AddLine ('to another and not copying all the BAT files. MarxMenu sets the')
  142. AddLine ('environment variable MXCMD to GOTO E in order to get here.')
  143. AddLine ('')
  144. AddLine ('*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*')
  145. AddLine ('')
  146. AddLine (':E')
  147. AddLine ('CLS')
  148. AddLine ('Echo  * * * * * * Warning * * * * * * *')
  149. AddLine ('Echo.')
  150. AddLine ('Echo  The file MXSTOP.BAT, DROPTO.BAT, and BATEXIT.BAT should be in')
  151. AddLine ('Echo  the same directory as the MARX.BAT file. Run MARXMENU INST in')
  152. AddLine ('Echo  the directory where you want MARX.BAT to reside.')
  153. AddLine (':ENDBAT')
  154.  
  155.  
  156. WriteTextFile 'MARX.BAT' FileLine
  157.  
  158. ClearLineBuffer
  159.  
  160. ;----- Here we create the DROPTO.BAT file.
  161.  
  162. Writeln
  163. Write ' Creating DROPTO.BAT ... '
  164.  
  165. AddLine ('DEL %1')
  166. AddLine ('SET KSV=')
  167. AddLine ('SET MXCMD=')
  168. AddLine ('%2 %3 %4 %5 %6 %7 %8 %9')
  169. AddLine ('BATEXIT')
  170. AddLine ('')
  171. AddLine ('*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*')
  172. AddLine ('')
  173. AddLine ('DropTo is used when you want to eliminate the temporary batch')
  174. AddLine ('file created by MarxMenu. This is useful if you shell to DOS')
  175. AddLine ('and then run MarxMenu from the dos shell. It avoids the')
  176. AddLine ('"Missing Batch File" error.')
  177. AddLine ('')
  178. AddLine ('DropTo is run from within the temporary batch file you want')
  179. AddLine ('to eliminate.')
  180. AddLine ('')
  181. AddLine ('Usage: DROPTO %0 <command line>')
  182. AddLine ('')
  183. AddLine ("Here's how it works:")
  184. AddLine ('')
  185. AddLine ('     $MX00000.BAT <------deletes this file--------+')
  186. AddLine ('     ------------                                 |')
  187. AddLine ('     DROPTO %0 COMMAND.COM ------------> DEL %1 >-+')
  188. AddLine ('                                         SET KSV=')
  189. AddLine ('                                         SET MXCMD=')
  190. AddLine ('              %2 executes command.com--> %2 %3 %4 %5 %6 %7 %8 %9')
  191. AddLine ('')
  192. AddLine ('*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*')
  193.  
  194. WriteTextFile 'DROPTO.BAT' FileLine
  195.  
  196. ClearLineBuffer
  197.  
  198. ;----- Here we create the MXSTOP.BAT file.
  199.  
  200. Writeln
  201. Write ' Creating MXSTOP.BAT ... '
  202.  
  203. AddLine ('SET MXCMD=')
  204. AddLine ('SET KSV=')
  205. AddLine ('REM From here, you control the menu exit process!')
  206.  
  207. WriteTextFile 'MXSTOP.BAT' FileLine
  208.  
  209. ClearLineBuffer
  210.  
  211. ;----- Here we create the GOFILE.BAT file.
  212.  
  213. Writeln
  214. Write ' Creating GOFILE.BAT ... '
  215.  
  216. AddLine (EchoSt)
  217. AddLine ('MARXMENU GOFILE %1')
  218. AddLine ('REM This batch file is used only with the GOFILE menu.')
  219.  
  220. WriteTextFile 'GOFILE.BAT' FileLine
  221.  
  222. ClearLineBuffer
  223.  
  224. ;----- Here we create the \LOGIN\OFF.BAT file.
  225.  
  226. if ExistDir '\LOGIN' and NetworkVersion
  227.    if not ExistFile '\LOGIN\OFF.BAT'
  228.  
  229.       Writeln
  230.       Write ' Creating OFF.BAT ... '
  231.  
  232.       AddLine ('ECHO ON')
  233.       AddLine ('')
  234.       AddLine ('REM This batch file is used to log off the network.')
  235.       AddLine ('REM Add the commands you want to execute when logoff occurs here.')
  236.       AddLine ('')
  237.       AddLine ('LOGOUT')
  238.  
  239.       WriteTextFile '\LOGIN\OFF.BAT' FileLine
  240.  
  241.       ClearLineBuffer
  242.    endif
  243. endif
  244.  
  245. Wait PauseTime
  246. EraseTopWindow
  247.  
  248. CheckEnvSize
  249.  
  250. EraseTopWindow
  251. BoxBorderColor Yellow Mag
  252. BoxInsideColor White Mag
  253. DrawBox 18 10 44 7
  254. BoxBorderColor LGreen Blue
  255. BoxInsideColor Yellow Blue
  256. DrawBox 23 12 34 3
  257. WriteCenter 'MarxMenu Installed!'
  258. Wait PauseTime * 2
  259. EraseTopWindow